From d22902b432092b59693396d56b9fb39f44544788 Mon Sep 17 00:00:00 2001 From: Jimi Xenidis Date: Thu, 25 Jan 2007 15:55:25 -0500 Subject: [PATCH] [XEN][XEND][POWERPC] Don't ignore shadow memory requirement We don't need a custom buildDomain() anymore but we do need to provide a shadow memory calculation. - Create PPC_LinuxImageHandler class to implement getRequiredShadowMemory(). - Derive prose builder from PPC_LinuxImageHandlerClass. - Drop configure() as it is not needed according to Jimi. Signed-off-by: Ryan Harper Signed-off-by: Jimi Xenidis --HG-- extra : transplant_source : %09%80%DF%BA%E7F%80%5CQpNb%A1%BCF%03%CD%81PA --- tools/python/xen/xend/image.py | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py index 1bfe6c7de2..1d916f917a 100644 --- a/tools/python/xen/xend/image.py +++ b/tools/python/xen/xend/image.py @@ -214,15 +214,23 @@ class LinuxImageHandler(ImageHandler): ramdisk = self.ramdisk, features = self.vm.getFeatures()) +class PPC_LinuxImageHandler(LinuxImageHandler): + ostype = "linux" + + def getRequiredShadowMemory(self, shadow_mem_kb, maxmem_kb): + """@param shadow_mem_kb The configured shadow memory, in KiB. + @param maxmem_kb The configured maxmem, in KiB. + @return The corresponding required amount of shadow memory, also in + KiB. + PowerPC currently uses "shadow memory" to refer to the hash table.""" + return max(maxmem_kb / 64, shadow_mem_kb) -class PPC_ProseImageHandler(LinuxImageHandler): - ostype = "prose" - def configure(self, vmConfig, imageConfig, deviceConfig): - LinuxImageHandler.configure(self, vmConfig, imageConfig, deviceConfig) - self.imageConfig = imageConfig +class PPC_ProseImageHandler(PPC_LinuxImageHandler): + + ostype = "prose" def buildDomain(self): store_evtchn = self.vm.getStorePort() @@ -249,15 +257,6 @@ class PPC_ProseImageHandler(LinuxImageHandler): ramdisk = self.ramdisk, features = self.vm.getFeatures()) - def getRequiredShadowMemory(self, shadow_mem_kb, maxmem_kb): - """@param shadow_mem_kb The configured shadow memory, in KiB. - @param maxmem_kb The configured maxmem, in KiB. - @return The corresponding required amount of shadow memory, also in - KiB. - PowerPC currently uses "shadow memory" to refer to the hash table.""" - return max(maxmem_kb / 64, shadow_mem_kb) - - class HVMImageHandler(ImageHandler): ostype = "hvm" @@ -588,7 +587,7 @@ class X86_Linux_ImageHandler(LinuxImageHandler): _handlers = { "powerpc": { - "linux": LinuxImageHandler, + "linux": PPC_LinuxImageHandler, "prose": PPC_ProseImageHandler, }, "ia64": { -- 2.30.2